//package com.smile.handler;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.smile.mqtt.handler.AbstractAirportOrganizationBindHandler;
//import org.eclipse.paho.client.mqttv3.MqttClient;
//import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
//import org.eclipse.paho.client.mqttv3.MqttException;
//import org.eclipse.paho.client.mqttv3.MqttMessage;
//import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
//import org.springframework.stereotype.Component;
//
//import java.util.ArrayList;
//
//@Component
//public class DefaultAirportOrganizationBindHandler extends AbstractAirportOrganizationBindHandler {
//    @Override
//    public Boolean process(String data, String tid, String bid) throws MqttException {
//
////        System.out.println(data);
//
////        DeviceConfigResponse<AirportBindErrorResult> deviceConfigResponse = new DeviceConfigResponse<>();
////        deviceConfigResponse.setBid(bid);
////        deviceConfigResponse.setTid(tid);
////
////        AirportBindErrorResult airportBindErrorResult = new AirportBindErrorResult();
////        airportBindErrorResult.setResultCode(0);
////        AirportBindErrorResult.BindErrorOutput bindErrorOutput = new AirportBindErrorResult.BindErrorOutput();
////        bindErrorOutput.setErrorInfos(new ArrayList<>());
////        airportBindErrorResult.setOutput(bindErrorOutput);
////        deviceConfigResponse.setData(airportBindErrorResult);
////        deviceConfigResponse.setTimestamp(System.currentTimeMillis());
////        deviceConfigResponse.setMethod("airport_organization_bind");
////        deviceConfigResponse.setGateway("8UUXN2800A00HX");
////
////
////        MqttMessage message = new MqttMessage();
////        message.setQos(0);
////        message.setRetained(true);
////        message.setPayload(JSONObject.toJSONString(deviceConfigResponse).getBytes());
////        MqttClient mqttClient = new MqttClient("tcp://120.211.119.131:1883", "feisuan-mqtt-producer-client", new MemoryPersistence());
////        MqttConnectOptions connOpts = new MqttConnectOptions();
////        connOpts.setUserName("feisuan");
////        connOpts.setPassword("feisuan123456".toCharArray());
////        mqttClient.connect(connOpts);
////
////        mqttClient.publish("thing/product/" + "8UUXN2800A00HX" + "/requests_reply", message);
//////        mqttCli
//
//        return Boolean.TRUE;
//    }
//}
